<template>
	
	<view class="home">
<!-- 		<HeaderNav bgcolor='rgba(248,248,248,.5)' text='查看' :showNavBackBtn='false' color='#000'>
			
		</HeaderNav> -->
		<view style="width: 100%; height: 100rpx;">
		</view>
		
		<view class="in">
			<view class = "title">
				<view style="line-height:150rpx; height: 150rpx;">
					<view style="position: absolute; top: 13rpx; left:rpx" >
						<image src="../../../static/icon/left(4).png" style="width: 100rpx; height: 100rpx;margin-left: 30rpx; margin-top: 20rpx;" @click="BackToCard"></image>
					</view>
					<view style="position: absolute; left: 80rpx;" >
						<text style="font-size: 42rpx; margin-left: 42rpx; color: white;">企业信息</text>
					</view>
				</view>
			</view>
<!-- 			<view class = "title">
				<image class="head-imgs" src="../../../static/imgs/head_image.jpg"></image>
				<text class ="name">慢慢</text>					
			</view> -->
			<view class="compile" >
					
				<view style="margin-top: 10rpx;">
					<view>
						<text style="font-weight:bold; font-size: 40rpx;">企业名称&ensp;:\n</text>
					</view>
					<view>
						<text>{{cn}}</text>
					</view>
				</view>
				
				<view>
					<view>
						<text style="font-weight:bold; font-size: 40rpx;">统一社会信用代码&ensp;:\n</text>
					</view>
					<view>
						<text>{{uscc}}</text>
					</view>
				</view>
				
				<view>
					<view>
						<text style="font-weight:bold; font-size: 40rpx;">联系人&ensp;:\n</text>
					</view>
					<view>
						<text>{{lar}}</text>
					</view>
				</view>
				<view>
					<view>
						<text style="font-weight:bold; font-size: 40rpx;">手机号&ensp;:\n</text>
					</view>
					<view>
						<text>{{telephone}}</text>
					</view>
				</view>
				<view>
					<view>
						<text style="font-weight:bold; font-size: 40rpx;">企业邮箱&ensp;:\n</text>
					</view>
					<view>
						<text>{{mail}}</text>
					</view>
				</view>
				
				<view>
					<view>
						<text style="font-weight:bold; font-size: 40rpx;">企业地址&ensp;:\n</text>
					</view>
					<view>
						<text>{{address}}</text>
					</view>+
				</view>
				
<!-- 				<view>
					<text>统一社会信用代码:\n &emsp;&emsp;&emsp;{{uscc}}</text>
				</view>
				<view>
					<text>联系人:\n &emsp;&emsp;&emsp;{{lar}}</text>
				</view>
				<view>
					<text>手机号:\n &emsp;&emsp;&emsp;{{telephone}}</text>
				</view>
				<view>
					<text>企业邮箱:\n &emsp;&emsp;&emsp;{{mail}}</text>
				</view>
				<view>
					<text>企业地址:\n &emsp;&emsp;&emsp;{{address}}</text>
				</view> -->
			</view>
		
			<!-- <view class="module">
				<view class="message">
					
				</view>
			</view>
			<view class="compile" >
					<textarea placeholder="xxx" auto-height="true" maxlength="20" style=" padding: 25rpx; width: 95%;"></textarea>
			</view>
			
			
			<view class="module">
				<view class="message">
					
				</view>
			</view>
			<view class="compile" >
					<textarea placeholder="xxx" auto-height="true" maxlength="15" style=" padding: 25rpx; width: 95%;"></textarea>
			</view>
			
			<view class="module">
				<view class="message">
					
				</view>
			</view>
			<view class="compile" >
					<textarea placeholder="1532103000" auto-height="true" maxlength="11" style=" padding: 25rpx; width: 95%;"></textarea>
			</view>
			<view class="module">
				<view class="message">
					
				</view>
			</view>
			<view class="compile" >
					<textarea placeholder="207454@qq.com" auto-height="true" maxlength="25" style=" padding: 25rpx; width: 95%;"></textarea>
			</view>
			<view class="module">
				<view class="message">
					
				</view>
			</view>
			<view class="compile" >
					<textarea disabled:true placeholder="xxx" auto-height="true" maxlength="40" style=" padding: 25rpx; width: 95%;"></textarea>
			</view> -->
		</view>
	</view>
</template>

<script>
	import HeaderNav from '@/common/HeaderNav/HeaderNav'
	import {getCompnayInfo as getCompnayInfoApi} from '@/api/user'
	export default {
		data() {
			return {
				cn:'',
				lar:'',
				telephone:'',
				password:'',
				cid:'',
				uscc:'',
				mail:'',
				address:'',
				code:'',
			}
		},
		onShow(){
			this.cid=this.$store.getters.getUser.cid
			this.uid=this.$store.getters.getUser.uid
			this.getCompnayInfo()
		},
		methods: {
			// 回到"我的"页面
			BackToCard(){
				uni.switchTab({
					url:'/pages/card/card'
				})
			},
			
			//获取企业信息
			async getCompnayInfo(){
				console.log(666)
				if(this.cid===null){
					uni.showToast({
						icon:'none',title:'当前未绑定企业'
					})
				}else{
					const data={
						cid:this.cid
					}
					console.log(data)
					const res = await getCompnayInfoApi(data)
						this.cn = res.data.cn
						this.uscc = res.data.uscc,
						this.lar= res.data.lar,
						this.telephone= res.data.telphone,
						this.mail= res.data.mail,
						this.address= res.data.address
				}
				
			}
			
		},
		components: {
			HeaderNav
		}
	}
</script>

<style lang ="scss" scoped>
	.home {
		width: 100vw;
		height: 1700rpx;
		background: linear-gradient(to top,#172349,#1d2e55,#203f5f,#4f5e72);
	}
	
	.in{
		width:100%;
		margin-top: -60rpx;
		height: 1600rpx;
	}
	.title{
		position: relative;
		border-bottom: 3rpx solid #b6b6b6;
		width: 100%;
		height: 150rpx;
		line-height: 150rpx;
		
		.head-imgs{
			width: 132rpx;
			height: 132rpx;
			border-radius: 50%;
		}
		
		.name{
			line-height: 100rpx;
			font-size: 30rpx;
			position:absolute;
			/* display: block; */
			height: 132rpx;
			width: 132rpx;
		}

	}
	.module{
		width: 100%;
		height:auto;
	}
	.message{
		width: 90%;
		height: 60rpx;
		margin-left: 5%;
		margin-top: 5%;
		font-size: 30rpx;
	}
	.compile{
		width: 90%;
		height: auto;
		line-height: 80rpx;
		border-radius: 10rpx;
		box-shadow: inset 0rpx 0rpx 6rpx 0rpx #ffffff; 
		margin-top: 50rpx;
		
		margin-left: 5%;
		font-size: 30rpx;
		text{
			margin-left: 5%;
			color: white;
			font-size: 36rpx;
		}
	}
	
	
	
	
</style>
